package com.yonyou.brigade.third_parties.common.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.yonyou.brigade.third_parties.common.model.ThirdProperty;
import com.yonyou.brigade.third_parties.common.dao.ThirdPropertyMapper;
import com.yonyou.brigade.third_parties.common.service.IThirdPropertyService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jiangzhf@yonyou.com
 * @since 2018-12-25
 */
@Service
public class ThirdPropertyServiceImpl extends ServiceImpl<ThirdPropertyMapper, ThirdProperty> implements IThirdPropertyService {

    @Override
    public  List<ThirdProperty> getThirdPropertyByTenantOrgChannel(String tenantId, String org, String channel) {
        Wrapper<ThirdProperty> wrapper = new EntityWrapper<>();
        wrapper.where("tenant={0}", tenantId);
        wrapper.andNew("org_pk={0}", org);
        wrapper.andNew("channel={0}", "ctripBC");
        return this.selectList(wrapper);
    }
}
